<?php

namespace mpend\logics;

use Yii;

/**
 * 微信端商品基础模型
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class ProductLogic extends \common\models\shop\ShopProduct {

    /**
     * VUE跳转链接
     */
    public function getLink() {
        return [
            'name' => 'goods/:id',
            'params' => [
                'id' => $this->id
            ],
        ];
    }

    /**
     * @since 1.0
     */
    public function fields() {
        return [
            'id',
            'name',
            'slogan',
            'description',
            'thumb',
            'price' => 'memberPrice',
            'market_price' => 'marketPrice',
            'link',
        ];
    }

}
